# -*- mode: python -*-

Import("env")

env.Library(
    target='write_conflict_exception',
    source=[
        'write_conflict_exception.cpp'
        ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/db/server_parameters'
        ]
)

env.Library(
    target='lock_manager',
    source=[
        'd_concurrency.cpp',
        'lock_manager.cpp',
        'lock_state.cpp',
        'lock_stats.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/util/background_job',
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/util/foundation',
        # Temporary crutch since the ssl cleanup is hard coded in background.cpp
        '$BUILD_DIR/mongo/util/net/network',
        '$BUILD_DIR/mongo/db/server_parameters',
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/mongo/util/concurrency/spin_lock',
        '$BUILD_DIR/third_party/shim_boost',
    ],
)

env.CppUnitTest(
    target='lock_manager_test',
    source=['d_concurrency_test.cpp',
            'deadlock_detection_test.cpp',
            'fast_map_noalloc_test.cpp',
            'lock_manager_test.cpp',
            'lock_state_test.cpp',
            'lock_stats_test.cpp',
    ],
    LIBDEPS=[
        'lock_manager'
    ]
)
